package com.daona.security.token;


import java.util.List;
import java.util.Optional;

public interface TokenRepository {

  /*@Query(value = """
      select t from Token t inner join User u\s
      on t.user.id = u.id\s
      where u.id = :id and (t.expired = false or t.revoked = false)\s
      """)*/
  List<Token> findAllValidTokenByUser(Integer id);

  Optional<Token> findByToken(String token);


  Token save(Token token);

  void saveAll(List<Token> tokens);
}
